package com.yvon.maple.service.msg.core.model.vo;

import com.alibaba.fastjson.JSONObject;
import com.yvon.maple.pojo.BaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Set;

/**
 * @author : Yvon
 * @since : 2021-09-02
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel("消息请求参数")
public class ImContentVo extends BaseVO implements Serializable {

    /**
     * 标题
     */
    @ApiModelProperty(name = "title", value = "标题", required = true)
    @NotEmpty(message = "标题不能为空!")
    private String title;

    /**
     * 内容
     */
    @ApiModelProperty(name = "content", value = "内容", required = true)
    @NotEmpty(message = "内容不能为空!")
    private String content;

    /**
     * 类型
     */
    @ApiModelProperty(name = "typeCode", value = "类型", required = true)
    @NotEmpty(message = "请选择消息类型!")
    private String typeCode;

    /**
     * 额外信息
     */
    @ApiModelProperty(name = "extras", value = "额外信息")
    private JSONObject extras;

    /**
     * 接收者账号
     */
    @ApiModelProperty(name = "consumers", value = "接收者账号", required = true)
    @Size(min = 1, message = "至少需要一个接收者!")
    private Set<String> consumers;
}
